﻿using System;
using System.Collections.Generic;
using System.Text;
using My.GenCode.Entities;
using My.GenCode.Interface;

namespace My.GenCode.Templates
{
    public class GenListPage : CodeTemplate
    {
        #region 覆盖父类的方法

        public GenListPage(string tpl, EntityInfo info, string desc) : base(tpl, info, desc) { }

        protected override string ProcTemplate()
        {
            _tpl = _tpl.Replace("<FileName>", _nh.ReadListPageFileName);               // 处理<FileName>标签
            _tpl = _tpl.Replace("<<NameSpace>>", _nh.NameSpace);                       // 处理<<NameSpace>>标签
            _tpl = _tpl.Replace("<<EntityClassName>>", _nh.EntityClassName);           // 处理<<EntityClassName>>标签
            _tpl = _tpl.Replace("<<ReadListMethodName>>", _nh.ReadListMethodName);     // 处理<<ReadListMethodName>>标签
            _tpl = _tpl.Replace("<<DeleteMethodName>>", _nh.ReadListMethodName);       // 处理<<ReadListMethodName>>标签
            _tpl = _tpl.Replace("<<HandlerClassName>>", _nh.HandlerClassName);         // 处理<<HandlerClassName>>标签

            return _tpl;
        }
        protected override string OutputFilename()
        {
            return @"Website\_Subpages\" + _nh.ReadListPageFileName;
        }

        #endregion
    }
}